/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.settlement.entity.customercarcontract;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.modules.base.entity.cars.Tcar;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 客户汽车供需合同Entity
 * @author LV
 * @version 2021-03-06
 */
@Table(name="t_customer_car_contract_detail", alias="a", columns={
		@Column(name="customer_car_contract_detail_id", attrName="customerCarContractDetailId", label="客户汽车供需合同明细ID", isPK=true),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="calculate_price", attrName="calculatePrice", label="计算车价"),
		@Column(name="price", attrName="price", label="单价", comment="单价（元）"),
		@Column(name="amount", attrName="amount", label="金额含税合计", comment="金额含税合计（元）"),
		@Column(name="invoice_code", attrName="invoiceCode", label="发票号"),
		@Column(name="invoice_date", attrName="invoiceDate", label="发票日期"),
		@Column(name="invoice_id", attrName="invoiceId", label="发票单"),
		@Column(name="remark", attrName="remark", label="备注"),
		@Column(name="customer_car_contract_id", attrName="customerCarContractId.customerCarContractId", label="客户汽车供需合同ID"),
	}, joinTable={
        @JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Tcar.class, attrName="tcar", alias="b",
                on="b.car_id = a.car_id", columns={
                @Column(name="car_id", label="车辆编码", isPK=true),
                @Column(name="car_name", label="车辆名称", isQuery=false),
        }),
}, orderBy="a.customer_car_contract_detail_id ASC"
)
public class CustomerCarContractDetail extends DataEntity<CustomerCarContractDetail> {
	
	private static final long serialVersionUID = 1L;
	private String customerCarContractDetailId;		// 客户汽车供需合同明细ID
	private String frameNumber;		// 车架号
	private String carId;		// 车辆
	private String carName;		// 车辆
	private Double calculatePrice;		// 计算车价
	private Double price;		// 单价（元）
	private Double amount;		// 金额含税合计（元）
	private String invoiceCode;		// 发票号
	private Date invoiceDate;		// 发票日期
	private String invoiceId;		// 发票单
	private String remark;		// 备注
	private CustomerCarContract customerCarContractId;		// 客户汽车供需合同ID 父类
    private Tcar tcar;
	
	public CustomerCarContractDetail() {
		this(null);
	}


	public CustomerCarContractDetail(CustomerCarContract customerCarContractId){
		this.customerCarContractId = customerCarContractId;
	}
	
	public String getCustomerCarContractDetailId() {
		return customerCarContractDetailId;
	}

	public void setCustomerCarContractDetailId(String customerCarContractDetailId) {
		this.customerCarContractDetailId = customerCarContractDetailId;
	}
	
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}
	
	public Double getCalculatePrice() {
		return calculatePrice;
	}

	public void setCalculatePrice(Double calculatePrice) {
		this.calculatePrice = calculatePrice;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
	@Length(min=0, max=100, message="发票号长度不能超过 100 个字符")
	public String getInvoiceCode() {
		return invoiceCode;
	}

	public void setInvoiceCode(String invoiceCode) {
		this.invoiceCode = invoiceCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}
	
	@Length(min=0, max=64, message="发票单长度不能超过 64 个字符")
	public String getInvoiceId() {
		return invoiceId;
	}

	public void setInvoiceId(String invoiceId) {
		this.invoiceId = invoiceId;
	}
	
	@Length(min=0, max=255, message="备注长度不能超过 255 个字符")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public CustomerCarContract getCustomerCarContractId() {
		return customerCarContractId;
	}

	public void setCustomerCarContractId(CustomerCarContract customerCarContractId) {
		this.customerCarContractId = customerCarContractId;
	}

    public Tcar getTcar() {
        return tcar;
    }

    public void setTcar(Tcar tcar) {
        this.tcar = tcar;
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }
}